/**
 * @param {number[]} nums
 * @param {number} k
 * new set 除去k值的size
 * @return {number}
 */
var minOperations = function(nums, k) {
    const min = Math.min(...nums)
    if (min < k ) return -1 
    const set = new Set(nums)
    if (set.has(k)) return set.size - 1
    else return set.size
};